package com.gxsyh.nantie.order.provider.service.impl;

import com.gxsyh.nantie.order.provider.domain.TbDepartment;

import javax.annotation.Resource;
import com.gxsyh.nantie.order.provider.mapper.TbDepartmentMapper;
import com.gxsyh.nantie.order.provider.TbDepartmentService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;

/**
 * @email yom535@outlook.com
 * @author: 刘锋嘉(Liu Fengjia)
 * @date: 2020/2/18
 * @time: 13:36
 * @Description: 
 */
@Transactional
@Service(version = "1.0.0")
public class TbDepartmentServiceImpl implements TbDepartmentService{

    @Resource
    private TbDepartmentMapper tbDepartmentMapper;

    @Override
    public TbDepartment selectOneByDepartmentId(Long departmentId) {
        Example example=new Example(TbDepartment.class);
        example.createCriteria().andEqualTo("id",departmentId);
        return tbDepartmentMapper.selectOneByExample(example);
    }

    @Override
    public TbDepartment selectOneByUserId(Long userId) {
        return tbDepartmentMapper.selectOneByUserId(userId);
    }
}
